package com.smart.seckilldemo.controller;

import com.smart.seckilldemo.commons.result.ResponseResult;
import com.smart.seckilldemo.pojo.User;
import com.smart.seckilldemo.commons.vo.GoodsVo;
import com.smart.seckilldemo.service.GoodsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * 商品列表 详情查询
 */
@Slf4j
@Controller
@RequestMapping("/goods")
public class GoodsController {

    @Resource
    GoodsService goodsService;
    @Resource
    RedisTemplate redisTemplate;


    /**
     * 跳转到商品列表页
     * @param
     * @param

     * @return
     */
    @RequestMapping(value = "/toList",produces = "text/html;charset=utf-8")
    @ResponseBody
    public String toList(User user, HttpServletRequest request, HttpServletResponse response){
        return null;
    }

    /**
     * 跳转商品详情页
     * @return
     */
    @RequestMapping(value = "/toDetail/{goodsId}")
    @ResponseBody
    public ResponseResult toDetail(User user, @PathVariable("goodsId") Long goodsId){
        return ResponseResult.success();
    }



}
